<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="javax.servlet.jsp.JspWriter"%>
<%@page import="org.emergency.framework.model.contactTree.TbPermissionTreeNode"%>
<%@page import="org.emergency.framework.model.contactTree.TbPermissionTree"%>
<%@page import="org.emergency.framework.common.Context"%>
<%@page import="org.emergency.framework.service.common.ITbPermissionTreeService"%>
<%--

这是权限配置
--%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'roles.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<%--
tree plug-in
--%>

<link type="text/css" rel="stylesheet" href="css/checktree.css" />
<%--
costom
--%>
   <jsp:include page="/common/Head.jsp" ></jsp:include>
<script src="oa/permission/js/allpermissionTree.js" type="text/javascript"></script>
</head>
<body>
<div>权限配置(现在没有删除功能</br>
</div></div>
<img alt="" src="img/column.gif" style='width:100%;height:5px'>
<div style = 'margin-left: 200px'>
		<%!public void printLocalTree(TbPermissionTreeNode node, ServletRequest request,
			ServletResponse response, JspWriter out) throws Exception {
			out.println("<ul class='tree' style='margin-left: 15px; '>");
		//	out.println("<lable>");
				out.println("<span class='nodeName unfold' >"+node.getName()+"</span>");
				//out.println("<image class='unfold' src= 'img/plus.gif' />");
				out.println("<span class='nodeid' >"+node.getNodeId()+"</span>");
				out.println("<span class='nodeDesc'>"+node.getDesc()+"</span>");
				out.println("<span class ='modifyNode'  style='cursor:pointer;color:blue;'>修改</span>");
				out.println("<span class = 'addchildren' style='cursor:pointer;color:blue;'>增加子节点</span>");	
				out.println("<span class = 'addchildren' style='cursor:pointer;color:blue;'>删除当前节点</span>");	
			//out.println("</lable>");
		List<TbPermissionTreeNode> nodeList = node.getChildren();
		for (int i = 0; i < nodeList.size(); i++) {
			out.println("<li id = "+nodeList.get(i).getNodeId()+" >");
			printLocalTree(nodeList.get(i), request, response, out);
			out.println("</li>");
		}
		out.println("</ul>");
	
	}%>
		<%
		TbPermissionTree permissionTree = ((ITbPermissionTreeService) Context.webApplicationContext
					.getBean("tbPermissionTreeServiceImpl")).getTbRoleTreeTree();

		TbPermissionTreeNode node = permissionTree.getRootNode();
			printLocalTree(node, request, response, out);
		%>
</div>
<img alt="" src="img/column.gif" style='width:100%;height:5px'>


<div style='text-align: center;'>
<input type='button' value='提交' class = 'submit'/>
<input type='button' value='返回' id = 'return'/>
</div>
<%--
修改的窗口
--%>
<div id="dialog-form-modify" title="修改权限信息">
			<form>
				<fieldset>
					<label for="name">
						权限编号
					</label>
					<div id = 'modify_id'></div>
				</fieldset>
				<fieldset>
					<label for="name">
						权限名称
					</label>
					<input type="text" id='modify_name'
						class="text ui-widget-content ui-corner-all" />
				</fieldset>
				<fieldset>
					<label for="name">
						权限URL
					</label>
					<input type="text" id='modify_url'
						class="text ui-widget-content ui-corner-all" />
				</fieldset>
			</form>
</div>

<%--
增加的窗口
--%>
<div id="dialog-form-add" title="增加权限">
			<form>
				<fieldset>
					<label for="name">
						父权限编号
					</label>
					<div id = 'add_id'></div>
				</fieldset>
				<fieldset>
					<label for="name">
						权限名称
					</label>
					<input type="text" id='add_name'
						class="text ui-widget-content ui-corner-all" />
				</fieldset>
				<fieldset>
					<label for="name">
						权限URL
					</label>
					<input type="text" id='add_url'
						class="text ui-widget-content ui-corner-all" />
				</fieldset>
			</form>
</div>
		
		
</body>
</html>
